home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Turnbull China Bikeride
/
Turnbull China Bikeride - Disc 2.iso
/
STUTTGART
/
UTIL
/
PROGRAMMING
/
RINK010
/
Demo
/
c
/
segment1
< prev
next >
Wrap
Text File
|
1995-06-25
|
1KB
|
57 lines
// rinkdemo - first segment
// (c) Ben Summers 1995
#include <stdio.h>
#include <stdlib.h>
// this next function definition would be in a header file in a real program
int FunctionInParentProgram(int Number);
// a defintion of a number in the parent. It would be defined in a header
// file. Obviously, direct access of data is not to be encouraged, but
// it is possible.
extern int NumberInParent;
// some static data for this segment
int TheNumber;
int Start(char *String, int Number)
{
printf("Start in segment 1, string = %s, number = %d\n\n", String, Number);
TheNumber = Number;
return TheNumber * 2;
}
void Do(void)
{
printf("Segment1 Do: number given at start = %d\n\n", TheNumber);
// call a function in the main program
printf("... and it returned %d\n\n", FunctionInParentProgram(189));
}
int Finish(int Number)
{
return 0;
}
void NamedEntry1(void)
{
printf("Doubling number in parent\n");
NumberInParent*=2;
}
void NamedEntry2(void)
{
printf("NumberInParent = %d\n\n", NumberInParent);
}